<template>
  <view class="go_login u-flex flex-center u-flex-col">
    <u-icon name="lock" size="80" color="#FF8B37"></u-icon>
    <view class="u-font-sm color-666 u-padding-30">请登录后查看数据</view>
    <navigator :url="`/pages/login/wx_login?backUrl=${backUrl}`" class="u-font-sm btn" open-type="reLaunch">登录</navigator>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        backUrl:''
      }
    },

    mounted() {
      var pages = getCurrentPages()
      let {route,options} = pages[pages.length - 1]
      if (options && Object.keys(options).length) {
        let paramsStr = '#'
        for(var n in options) {
          paramsStr += `${n}*${options[n]}@`
        }
        paramsStr = paramsStr.substr(0, paramsStr.length - 1)
        this.backUrl = route + paramsStr
      } else {
        this.backUrl = route
      }
    }
  }
</script>

<style scoped>
  .go_login {
    width: 100%;
    height: 100%;
  }
  .btn {
    height: 90upx;
    line-height: 90upx;
    width: 400upx;
    background: #FF8B37;
    border-radius: 45upx;
    color: #fff;
    text-align: center;
  }
</style>
